<template>
  <div class="workbench" >
    <div class="workHeader">
      <span class="hIcon"></span>
      <span style="font-size:0.4rem" v-if="useInfo.userTypeId!=4||!workData.title2" >{{workData.title}}</span>
      <span style="font-size:0.4rem" v-if="useInfo.userTypeId==4&&workData.title2" >{{workData.title2}}</span>
    </div>
    <div class="workContainer">
      <div class="ContainerChild" v-for="(item,index) in workData.child"  v-if="item.voOperate&&item.voOperate.selectObj&&!item.hide"  @click='workbench(item)' :key=index>
        <img :src="item.imgSrc" style="width:0.9rem">
        <div v-if="useInfo.userTypeId!=4||!item.text2">{{item.text}}</div>
        <div v-if="useInfo.userTypeId==4">{{item.text2}}</div>
      </div>
    </div>
  </div>
</template>
<script>
    export default {
        data() {
            return {

            }
        },
        props: ['workData', 'useInfo'],
        methods: {
            workbench(item) {
                if (item.fun) {
                    item.fun();
                } else {
                    this.$api.clearItem();

                    this.$router.push({
                        path: item.href,
                    });
                }
                // this.$emit('workbench',item.parameter);
            },
        },
    }
</script>
<style scoped>
    .workbench {
        background: #fff;
        /* padding: 0  0 .5rem 0; */
    }
    
    .hIcon {
        width: 0.2rem;
        height: .5rem;
        background: rgb(4, 137, 255);
        margin: 0 .3rem;
    }
    
    .workHeader {
        display: flex;
        display: -webkit-flex;
        align-items: center;
        height: 0.8rem;
        padding: 0.0rem .2rem;
        font-weight: bold;
    }
    
    .workContainer {
        display: flex;
        display: -webkit-flex;
        flex-wrap: wrap;
    }
    
    .ContainerChild {
        width: 2.5rem;
        font-size: .3rem;
        display: flex;
        display: -webkit-flex;
        flex-direction: column;
        justify-content: center;
        align-content: center;
        align-items: center;
        padding: 0.1rem .3rem;
        box-sizing: border-box;
    }
    
    a {
        color: inherit;
        text-decoration: none;
    }
</style>